package cz.via.wowss.entities;

import java.math.BigDecimal;
import java.sql.Timestamp;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
// @IdClass(HistoryPK.class)
@Table(name = "COMPANY_HISTORY")
public class CompanyHistory {

	@Id
	@ManyToOne
	@JoinColumn(name = "COMPANY_ID", nullable = false)
	private Company company;

	@Id
	@Column(name = "DATE", nullable = false)
	private Timestamp date;

	@Column(name = "PRICE_PER_STOCK", nullable = false)
	private BigDecimal pricePerStock;

	public CompanyHistory() {

	}

	public CompanyHistory(Company c, Timestamp date2, BigDecimal value) {
		this.company = c;
		this.date = date2;
		this.pricePerStock = value;
	}

	public Company getCompany() {
		return company;
	}

	public void setCompany(Company company) {
		this.company = company;
	}

	public Timestamp getDate() {
		return date;
	}

	public void setDate(Timestamp date) {
		this.date = date;
	}

	public BigDecimal getPricePerStock() {
		return pricePerStock;
	}

	public void setPricePerStock(BigDecimal pricePerStock) {
		this.pricePerStock = pricePerStock;
	}
}
